package com.own.core.managment;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.own.core.object.admin.User;
import com.own.core.operation.DbOperation;

public class CoreFacade {

	public static User authorizedUser(String userName ,String password){
		Map paraMap = new HashMap();
		paraMap.put("userName",userName);
		paraMap.put("password",password);
		List userList = DbOperation.getME()
				.executeNamedQuery("authorizedUser",paraMap);
		if(userList.isEmpty()||userList.size()>1){
			return null;
			
		}
		
		return (User) userList.get(0);
	}
	
	
	
}
